#ifndef ___COMBAT_CALCULATE_RULES_I____
#define ___COMBAT_CALCULATE_RULES_I____

#include "Entry/LibExportCom.h"

//
//
//
struct TCOM_API CombatResult
{
	enum
	{
		Succeed,
		OOM,					//	Out of Mana		
		Miss,					//	Miss
		Immuned,				//	Immuned
		NoTarget,				//	No Target or Target Not Found
		Targeting,				//	Finding Target
		Forbidden,				//	Forbidden to cast this
		Busy,					//	Busy, or NoResponse	
		Other,
	};

	CombatResult()
		:m_nResult(Succeed),
		m_nHPAffected(0),
		m_bCriticalHit(false),
		m_bHasGene(false)
	{
		;
	}

	int	m_nResult;
	int m_nHPAffected;		//		damage

	bool m_bCriticalHit;	//	whether it is a critical hit
	bool m_bHasGene;		//	whether gene effect is triggered
};

class ICombatSys;
class CombatSkill;
class ICombatCalculator;


//
// Combat calculate Interface
//
class TCOM_API  ICombatCalculator
{
public:
	virtual ~ICombatCalculator(){;}

	//
	//	calculate the combat result
	//
	virtual	bool	doCalc(CombatSkill& ab, ICombatSys& c, ICombatSys& t, CombatResult& r) = 0;
};

#endif
